<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>装维管理</title>
    <link rel="stylesheet" href="../resources/layui/css/layui.css">
</head>
<body class="bd-bg">
<div>
    <div>
        <h2 class="title">装维信息</h2>
        <div>
            <table id="content" lay-filter="content"></table>
        </div>
    </div>
</div>

<script src="../resources/layui/layui.js"></script>
<script src="../resources/flexible/src/flexible.js"></script>
<script src="../resources/flexible/src/makegrid.js"></script>
<script type="text/html" id="xuhao">
    {{d.LAY_TABLE_INDEX+1}}
</script>
<script type="text/html" id="toolbarTemplet">
    <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="detail">详情</a>
</script>
<script>
    layui.use('table', function(){
        var table = layui.table;
        table.render({
            elem: '#content'
            // ,height: 500
            ,url: '/app/work/queryList' //数据接口
            ,page: true //开启分页
            ,cols: [[ //表头
                {field: 'id', title: '', width:15, align:'center', templet: '#xuhao', fixed: 'left'}
                ,{field: 'accessNum', title: '接入号', width:90, align:'center', sort: true}
                ,{field: 'clientName', title: '客户名称', width:90, align:'center'}
                ,{field: 'clientAddress', title: '客户地址', width:90, align:'center'}
                ,{fixed: 'right', title: '操作', toolbar:'#toolbarTemplet',width:60}
            ]]
        });
        table.on('tool(content)', function(obj){
            var data = obj.data;
            var id = data.id;
            if(obj.event == 'detail'){
                var contenUrl = "<%=basePath%>work/toDeviceDetail";// + data.id;
                window.location.href= contenUrl;
            }
        });
    });
</script>
</body>
<style type="text/css">
    .title {
        margin: 5px 5px 0px 5px;
    }
</style>
</html>